<%
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", -1); //prevents caching at the proxy server
%>
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.text.*"%>
<%@ include file="Connections/conDB.jsp" %>
<% int validaSession = 2; %>
<%@ include file="Connections/session.jsp" %>

<%
String parId_ruta = request.getParameter("ruta");
String parId_trans = request.getParameter("trans");
String id_rutatrans = request.getParameter("id_rutatransporte");
//out.println("<br>" + id_rutatrans);

Driver DriverRs = (Driver)Class.forName(MM_conDB_DRIVER).newInstance();
Connection ConnRs = DriverManager.getConnection(MM_conDB_STRING,MM_conDB_USERNAME,MM_conDB_PASSWORD);
String query ="";
PreparedStatement StatementRs =null;

if(parId_ruta!=null && !parId_ruta.equals("") && parId_trans!=null && !parId_trans.equals("")){
	//--- elimina el ruta
	query= " DELETE ruta_trans WHERE id_rutatrans="+id_rutatrans;
	//AND ruta = "+parId_ruta+" AND transporte ="+parId_trans;
	//out.println("<br>" + query);
	StatementRs=ConnRs.prepareStatement(query);
   	StatementRs.executeUpdate();

} // if(parId_ruta!=null && parId_ruta.length()>0)

	out.print("<script>");
	out.print("window.opener.location.reload();");
	out.print("window.close();");
	out.print("</script>");
ConnRs.close();
%>
<html>
<head>
<title>CIMA v2 - Eliminar Ruta</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="miestilo.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<center>
<br>
  <table width="250" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center">La Ruta-Costo ha sido Eliminado.</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td align="center"> 
        <input type="button" name="Button" value="Aceptar" class="boton" onClick="window.opener.location.reload();window.close()">
      </td>
    </tr>
  </table>
</center>
</body>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</html>
